cmake_minimum_required(VERSION 3.8)
project(bot_dwa)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# 添加包资源安装
install(
  DIRECTORY launch
  DESTINATION share/${PROJECT_NAME}
)


find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(sensor_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(nav_msgs REQUIRED)
find_package(std_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(gazebo_msgs REQUIRED)
find_package(tf2_geometry_msgs REQUIRED) 


# DWA 规划
add_executable(dwa_planner src/dwa_planner.cpp)
ament_target_dependencies(dwa_planner
  rclcpp
  sensor_msgs
  std_msgs
  geometry_msgs
  gazebo_msgs
  tf2_ros
  tf2_geometry_msgs
  nav_msgs
)

# 安装目标
install(TARGETS
  dwa_planner
  DESTINATION lib/${PROJECT_NAME}
)

# 安装包资源
install(
  DIRECTORY 
    launch
  DESTINATION share/${PROJECT_NAME}
)

# 安装 package.xml
install(
  FILES package.xml
  DESTINATION share/${PROJECT_NAME}
)

ament_package()